﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Functions/Messege/messege.master" AutoEventWireup="true" CodeBehind="SentItems.aspx.cs" Inherits="HRDexCapstoneProject.Functions.Messege.WebForm3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainPage" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="MessageID" DataSourceID="SentItems" 
        onselectedindexchanged="GridView1_SelectedIndexChanged">
        <Columns>
            <asp:BoundField DataField="MessageID" HeaderText="MessageID" 
                InsertVisible="False" ReadOnly="True" SortExpression="MessageID" 
                Visible="False" />
            <asp:BoundField DataField="Subject" HeaderText="Subject" 
                SortExpression="Subject" />
            <asp:BoundField DataField="Description" HeaderText="Description" 
                SortExpression="Description" />
            <asp:BoundField DataField="DateTime" HeaderText="DateTime" 
                SortExpression="DateTime" />
            <asp:BoundField DataField="EmployeeID" HeaderText="EmployeeID" 
                SortExpression="EmployeeID" />
            <asp:BoundField DataField="catMessegeID" HeaderText="catMessegeID" 
                SortExpression="catMessegeID" />
            <asp:BoundField DataField="fromEmpID" HeaderText="fromEmpID" 
                SortExpression="fromEmpID" />
            <asp:BoundField DataField="AttachmentName" HeaderText="AttachmentName" 
                SortExpression="AttachmentName" />
             <asp:ButtonField HeaderText="View" Text="View" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SentItems" runat="server" 
        ConnectionString="<%$ ConnectionStrings:HRmainConnectionString %>" 
        
        SelectCommand="SELECT formMessegeSender.MessageID, formMessegeSender.Subject, formMessegeSender.DateTime, formEmployees.LastName + ', ' + formEmployees.FirstName AS fulname, formMessegeSender.fromEmpID, formMessegeSender.AttachmentName, formMessegeSender.Parent, catMessege.catMessegeName FROM formMessegeSender INNER JOIN formEmployees ON formMessegeSender.EmployeeID = formEmployees.EmployeeID INNER JOIN catMessege ON formMessegeSender.catMessegeID = catMessege.catMessegeID WHERE (formMessegeSender.EmployeeID = @EmployeeID)">
        <SelectParameters>
            <asp:SessionParameter Name="EmployeeID" SessionField="EmployeeID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>
